
package com.iyouqu.dycm.search.utils.redis;

import redis.clients.jedis.JedisPubSub;

import java.util.Map;


public class RedisPubSubListener<K, V> extends JedisPubSub {
  private Map<K, V> map;
  
  public RedisPubSubListener(Map<K, V> map) {
    
    this.map = map;
  }
  
  /*
   * (non-Javadoc)
   * 
   * @see redis.clients.jedis.JedisPubSub#onMessage(java.lang.String,
   * java.lang.String)
   */
  @Override
  public void onMessage(String channel, String message) {
    map.remove(message);
  }
  
  /*
   * (non-Javadoc)
   * 
   * @see redis.clients.jedis.JedisPubSub#onPMessage(java.lang.String,
   * java.lang.String, java.lang.String)
   */
  @Override
  public void onPMessage(String arg0, String arg1, String arg2) {
    
  }
  
  /*
   * (non-Javadoc)
   * 
   * @see redis.clients.jedis.JedisPubSub#onPSubscribe(java.lang.String, int)
   */
  @Override
  public void onPSubscribe(String arg0, int arg1) {
    
  }
  
  /*
   * (non-Javadoc)
   * 
   * @see redis.clients.jedis.JedisPubSub#onPUnsubscribe(java.lang.String, int)
   */
  @Override
  public void onPUnsubscribe(String arg0, int arg1) {
    
  }
  
  /*
   * (non-Javadoc)
   * 
   * @see redis.clients.jedis.JedisPubSub#onSubscribe(java.lang.String, int)
   */
  @Override
  public void onSubscribe(String arg0, int arg1) {
  }
  
  /*
   * (non-Javadoc)
   * 
   * @see redis.clients.jedis.JedisPubSub#onUnsubscribe(java.lang.String, int)
   */
  @Override
  public void onUnsubscribe(String arg0, int arg1) {
    
  }
  
}
